package com.zm.openapi.lb;

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @description:
 * @module: com.zm.apigateway.loadbalance
 * @author: songxiongli
 * @date: 2020-08-11 19:49
 **/
@SpringBootConfiguration
public class LoadBalanceConfig {

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    // 暂时用不上的样子
//    @Bean
//    public TokenLoadBalancerClientFilter userLoadBalanceClientFilter(LoadBalancerClient client, LoadBalancerProperties properties) {
//        return new TokenLoadBalancerClientFilter(client, properties);
//    }

}
